package org.blogwu.learn.multithread.chapter2.demo1;

import org.blogwu.jvm_learn.bean.User;

/**
 * 直接调用stop停止线程
 *
 * @author hyf
 * @date 2018-09-08
 **/
public class StopThreadUnSafe implements Runnable {

    public static User user = new User();

    @Override
    public void run() {
        synchronized (user) {
            user.setId(System.currentTimeMillis());
            try {
                Thread.sleep(10000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            user.setName("SB");
        }
    }

}
